<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>H+ 后台主题UI框架 - 空白页</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <link rel="shortcut icon" href="favicon.ico"> <link href="__STATIC__/layout/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="__STATIC__/layout/css/font-awesome.css?v=4.4.0" rel="stylesheet">
     <!-- jqgrid-->
    <link href="__STATIC__/layout/css/plugins/jqgrid/ui.jqgrid.css?0820" rel="stylesheet">
    <link href="__STATIC__/layout/css/animate.css" rel="stylesheet">
    <link href="__STATIC__/layout/css/style.css?v=4.1.0" rel="stylesheet">
    <link href="__STATIC__/layout/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
    <link href="__STATIC__/layout/css/gyq.css" rel="stylesheet">
    <link rel="stylesheet" href="__STATIC__/layout/css/demo.css" type="text/css">
    <link rel="stylesheet" href="__STATIC__/layout/css/zTreeStyle.css" type="text/css">
       <script src="__STATIC__/layout/js/jquery.min.js?v=2.1.4"></script>
    <script src="__STATIC__/sc/js/page.js"></script>
    <style>
    #gopage{color:blue;cursor: pointer;}
    #firstpage{cursor: pointer;}
    #pagesize{height:23px;}
    </style>
</head>

<body style="color:#333;padding:3px;">
    <!-- 标题 -->
      <div class="page-heade">
       <h2 class="title_color text-center">经销商销售目标统计查询</h2>
    </div>
    <!-- 标题 -->

    <!-- 筛选 -->
    <form class="form-inline table container-fluid formpage"  method="post" id="form_check">
    <input type="hidden" value='{$page}' name="page" id="page-go"/>
                      <input type="hidden" value='{$list}' name="list" id="list-go"/>
      <div class="form-group table margin-10">
        <label for="exampleInputName2">经销商名称：</label>
        <input class="form-control" type="text" name="jingxiao" value="{$data.jingxiao}" placeholder="">
      </div>
      <div class="hr-line-dashed"></div>
      <div class="form-group">
        <label for="exampleInputEmail2">品牌：</label>
        <select class="form-control" name="pinpai" id="pinpai">
          <option value="0">请选择品牌</option>
          {volist name="pinpai" id="vop"}
            {if condition="$data.pinpai eq $vop.id"}
            <option value="{$vop.id}" selected>{$vop.brand_name}</option>
            {else/}
            <option value="{$vop.id}">{$vop.brand_name}</option>
            {/if}
          {/volist}
        </select>
      </div>
       <div class="form-group margin-10">
        <label for="exampleInputEmail2">二级考核期：</label>
       <select class="form-control" name="cainian" id="cainian">
          <option value="0">请选择财年</option>
          {volist name="cainian" id="voc"}
            {if condition="$data.cainian eq $voc.id"}
            <option value="{$voc.id}" selected>{$voc.title}</option>
            {else/}
            <option value="{$voc.id}">{$voc.title}</option>
            {/if}
          {/volist}
        </select>
        <select class="form-control" name="yijikaoheqi" id="yijikaoheqi">
          <option value="0">请选择一级考核期</option>
        </select>
        <select class="form-control" name="erjikaoheqi" id="erjikaoheqi">
          <option value="0">请选择二级考核期</option>
        </select>
      </div>

      <div class="container-fluid margin-10 text-center">
        <input type="button" value="查询" class='btn btn-outline btn-primary' id="check"/>
        <input type="button" value="清空查询条件" class='btn btn-outline btn-warning' id="clear_check"/>
             <input type="button" value="导出数据" class='btn btn-outline btn-success'/>
      </div>
    </form>
    <!-- 筛选 -->

    <!-- 表格 -->






    <div class="col-md-12 no-padding"  style="padding: 0 12px;">
    {if condition="$sum neq 0"}
        <table class="table table-hover table-bordered text-center table-striped bud_hei">
          <tr class="info">
            <th class="text-center">明细编号</th>
            <th class="text-center">经销商名称</th>
            <th class="text-center">品牌</th>
            <th class="text-center">财年</th>
            <th class="text-center">一级考核期</th>
            <th class="text-center">二级考核期</th>
            <th class="text-center">目标金额（元）</th>
          </tr>
          {volist name="apply" id="vo"}
          <tr>
			<td>{$vo.no}-{$vo.detail_no}</td>
			<td>{$vo.jingxiao}</td>
			<td>{$vo.pinpai}</td>
			<td>{$vo.cainian}</td>
			<td>{$vo.yijikaoheqi}</td>
			<td>{$vo.erjikaoheqi}</td>
			<td>{$vo.feiyong}</td>
          </tr>
          {/volist}
        </table>
       <h5 class="text-center" id="pagesc" style="font-size: 16px;font-weight: 500">
            <script>
                            $(function(){
                                pageSC("pagesc",{$sum},{$page},{$maxpage})
                            })
                        </script>
          每页显示
          <select id="pagesize">
               
            <option value='20'{if condition="$list eq 20"}selected{/if}>20条</option>
			<option value='40'{if condition="$list eq 40"}selected{/if}>40条</option>
			<option value='50'{if condition="$list eq 50"}selected{/if}>50条</option>
          </select>
        </h5>
        {else/}
        <h3 class="text-center animated fadeIn">对不起没有查询到符合条件的信息</h3>
    		{/if}
       
      </div>
    <!-- 表格 -->
    <div>

    </div>
  
        
    </div>
    
    <!-- 全局js -->
    <script src="__STATIC__/layout/js/bootstrap.min.js?v=3.3.6"></script>
    <!-- <script src="js/plugins/metisMenu/jquery.metisMenu.js"></script> -->
    <script src="__STATIC__/layout/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
    <!-- <script src="js/plugins/layer/layer.min.js"></script> -->

    <!-- 自定义js -->
    <script src="__STATIC__/layout/js/content.js?v=1.0.0"></script>
     <script src="__STATIC__/layout/js/plugins/sweetalert/sweetalert.min.js"></script>
    
    <!-- ztree -->
    <script type="text/javascript" src="__STATIC__/layout/js/jquery.ztree.core.js"></script>
    <script type="text/javascript" src="__STATIC__/layout/js/jquery.ztree.excheck.js"></script>
    <!-- <script type="text/javascript" src="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script> -->
    <!--统计代码，可删除-->
    <script src="__STATIC__/layout/js/plugins/layer/laydate/laydate.js"></script>
    <script>

       //翻页
       
        $("#check").click(function(){
              $("#page-go").val(1);
              $(".formpage").submit();
        })
        $("#clear_check").click(function(){
            $("input[type='text']").val("");
            $("#page-go").val(1);
            
            $("select").val(0);
             $(".formpage").submit();
        })
         var kaohe1json='{$jsonkaohe1}';
        var kaohe1arr=JSON.parse(kaohe1json);
        var kaohe2json='{$jsonkaohe2}';
        var kaohe2arr=JSON.parse(kaohe2json);
         {if $data.cainian}
            yikaoxy();
            {/if}
            {if $data.yijikaoheqi}
            $("#yijikaoheqi").val({$data.yijikaoheqi})
            erkaoxy();
            {/if}
            {if $data.erjikaoheqi}
               $("#erjikaoheqi").val({$data.erjikaoheqi})
            {/if}
        $(function(){
         $("#cainian").change(function(){
            
            yikaoxy();
            erkaoxy();
            
          })
          $("#yijikaoheqi").change(function(){
            
            erkaoxy();
          })
          
        	
        	
        })
       //一级考核期显示隐藏
      function yikaoxy(){
        $("#yijikaoheqi").html('<option value="0">请选择一级考核期</option>')
        for(var i=0;i<kaohe1arr.length;i++){
          if(kaohe1arr[i]["cainian"]==$("#cainian").val()){
            $("#yijikaoheqi").append('<option value="'+kaohe1arr[i]["id"]+'">'+kaohe1arr[i]["title"]+'</option>')
          }
        }
        erkaoxy();
      }
      //二级考核期显示隐藏
       function erkaoxy(){
         $("#erjikaoheqi").html('<option value="0">请选择二级考核期</option>')
         for(var i=0;i<kaohe2arr.length;i++){
          if(kaohe2arr[i]["yijikaoheqi"]==$("#yijikaoheqi").val()){
            $("#erjikaoheqi").append('<option value="'+kaohe2arr[i]["id"]+'">'+kaohe2arr[i]["title"]+'</option>')
          }
        }
      }
   
    </script>
</body>

</html>
